uchardet_sources = files(
  'CharDistribution.cpp',
  'JpCntx.cpp',
  'LangModels/LangArabicModel.cpp',
  'LangModels/LangBulgarianModel.cpp',
  'LangModels/LangCroatianModel.cpp',
  'LangModels/LangCzechModel.cpp',
  'LangModels/LangDanishModel.cpp',
  'LangModels/LangEsperantoModel.cpp',
  'LangModels/LangEstonianModel.cpp',
  'LangModels/LangFinnishModel.cpp',
  'LangModels/LangFrenchModel.cpp',
  'LangModels/LangGermanModel.cpp',
  'LangModels/LangGreekModel.cpp',
  'LangModels/LangHebrewModel.cpp',
  'LangModels/LangHungarianModel.cpp',
  'LangModels/LangIrishModel.cpp',
  'LangModels/LangItalianModel.cpp',
  'LangModels/LangLatvianModel.cpp',
  'LangModels/LangLithuanianModel.cpp',
  'LangModels/LangMalteseModel.cpp',
  'LangModels/LangNorwegianModel.cpp',
  'LangModels/LangPolishModel.cpp',
  'LangModels/LangPortugueseModel.cpp',
  'LangModels/LangRomanianModel.cpp',
  'LangModels/LangRussianModel.cpp',
  'LangModels/LangSlovakModel.cpp',
  'LangModels/LangSloveneModel.cpp',
  'LangModels/LangSpanishModel.cpp',
  'LangModels/LangSwedishModel.cpp',
  'LangModels/LangThaiModel.cpp',
  'LangModels/LangTurkishModel.cpp',
  'LangModels/LangVietnameseModel.cpp',
  'nsBig5Prober.cpp',
  'nsCharSetProber.cpp',
  'nsEUCJPProber.cpp',
  'nsEUCKRProber.cpp',
  'nsEUCTWProber.cpp',
  'nsEscCharsetProber.cpp',
  'nsEscSM.cpp',
  'nsGB2312Prober.cpp',
  'nsHebrewProber.cpp',
  'nsLatin1Prober.cpp',
  'nsMBCSGroupProber.cpp',
  'nsMBCSSM.cpp',
  'nsSBCSGroupProber.cpp',
  'nsSBCharSetProber.cpp',
  'nsSJISProber.cpp',
  'nsUTF8Prober.cpp',
  'nsUniversalDetector.cpp',
  'uchardet.cpp',
)

uchardet_args = ['-DVERSION="@0@"'.format(meson.project_version())]

uchardet = library(
  'uchardet',
  uchardet_sources,
  cpp_args: base_cpp_args + uchardet_args,
)

uchardet_dep = declare_dependency(
  link_with: uchardet,
  include_directories: include_directories('.'),
)
